package com.cssy.yd.basic.dao.impl;

import java.util.List;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.yd.basic.dao.BasicModePaymentDAO;
import com.cssy.yd.basic.entity.BasicAreaDO;
import com.cssy.yd.basic.entity.BasicModePaymentDO;
import com.plat.helper.SearchConditions;

/**
 * ��ݷ��ʶ���ʵ����
 * @since 2013-06-19
 */
public class BasicModePaymentDAOImpl extends SqlMapClientDaoSupport implements BasicModePaymentDAO {

    /**
     * �������
     * @param basicModePaymentDO
     * @return ������ݵ�����
     */
    public String insertBasicModePaymentDO(BasicModePaymentDO basicModePaymentDO) throws DataAccessException {
        Object id = getSqlMapClientTemplate().insert("BasicModePayment.insert", basicModePaymentDO);
        return (String) id;
    }

    /**
     * ͳ�Ƽ�¼��
     * @param basicModePaymentDO
     * @return ����ļ�¼��
     */
    public Integer countBasicModePaymentDOByExample(BasicModePaymentDO basicModePaymentDO) throws DataAccessException {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicModePayment.countByDOExample", basicModePaymentDO);
        return count;
    }

    /**
     * ���¼�¼
     * @param basicModePaymentDO
     * @return ��Ӱ�������
     */
    public Integer updateBasicModePaymentDO(BasicModePaymentDO basicModePaymentDO) throws DataAccessException {
        int result = getSqlMapClientTemplate().update("BasicModePayment.update", basicModePaymentDO);
        return result;
    }

    /**
     * ��ȡ�����б�
     * @param basicModePaymentDO
     * @return �����б�
     */
    @SuppressWarnings("unchecked")
    public List<BasicModePaymentDO> findListByExample(BasicModePaymentDO basicModePaymentDO) throws DataAccessException {
        List<BasicModePaymentDO> list = getSqlMapClientTemplate().queryForList("BasicModePayment.findListByDO", basicModePaymentDO);
        return list;
    }

    /**
     * ��������ȡbasicModePaymentDO
     * @param id
     * @return basicModePaymentDO
     */
    public BasicModePaymentDO findBasicModePaymentDOByPrimaryKey(String id) throws DataAccessException {
        BasicModePaymentDO basicModePaymentDO = (BasicModePaymentDO) getSqlMapClientTemplate().queryForObject("BasicModePayment.findByPrimaryKey", id);
        return basicModePaymentDO;
    }

    /**
     * ɾ���¼
     * @param id
     * @return ��Ӱ�������
     */
    public Integer deleteBasicModePaymentDOByPrimaryKey(String id) throws DataAccessException {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("BasicModePayment_ex.deleteById", id);
        return rows;
    }

    @Override
   	public List<BasicModePaymentDO> find(SearchConditions scs)
   			throws DataAccessException {
   		List<BasicModePaymentDO> list = getSqlMapClientTemplate().queryForList("BasicModePayment_ex.find", scs);
   		return list;
   	}

   	@Override
   	public Integer count(SearchConditions scs) throws DataAccessException {
   		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicModePayment_ex.count", scs);
   		return count;
   	}
}